package container.list;

import java.util.LinkedList;
import java.util.List;
import java.util.UUID;

public class T01_ArrayList {
    /**
     * java.util.ConcurrentModificationException
     */
    public static void main(String[] args) {
        List<String> list =
                // new ArrayList<>();
                new LinkedList<>();

        for (int i = 0; i < 30; i++) {
            new Thread(() -> {
                list.add(UUID.randomUUID().toString().substring(0, 8));
                // list.forEach(System.out::println);
                System.out.println(list);
            }, String.valueOf(i)).start();
        }
    }
}
